use std::sync::Arc;

use atomic_refcell::AtomicRefCell;
use hashbrown::HashMap;
use honeybee::prelude::*;

use super::user::User;
use crate::room_manager::RoomManager;

pub struct Room {
    manager_addr: Addr<RoomManager>,
    users: AtomicRefCell<HashMap<u64, Arc<User>>>,
}

impl Room {
    pub fn new(uid: u64, manager_addr: Addr<RoomManager>) -> Arc<Self> {
        Arc::new(Self {
            manager_addr,
            users: AtomicRefCell::default(),
        })
    }
}
